﻿using System;
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Shell;
using Red.Scripts.Defines;
using Red.Scripts.Options.Tool.Bar.Extensions;

namespace Red.Scripts.Options.Tool.Bar
{
    [Export]
    public class ManageSccProcess
    {
        #region Imports

        [Import]
        private Language.Scc.Connection Connection { get; set; }

        #endregion Imports

        #region C-Tor

        public ManageSccProcess()
        {
        }

        #endregion C-Tor

        #region Public Methods

        public void Initialize( OleMenuCommandService commandService )
        {
            commandService.InitializeButton( Toolbar.Guid, Toolbar.ShutdownSccButtonId, DoShutdown );
        }

        #endregion Public Methods

        #region Private Methods

        #endregion Private Methods

        #region Event Handlers

        private void DoShutdown( object sender, EventArgs e )
        {
            Connection.Disconnect();

        }

        #endregion Event Handlers
    }
}
